import {lazy} from "react" // 用于懒加载的
import {Navigate} from "react-router-dom" //Navigate就是重定向
const Show = lazy(()=>import("../pages/show"))
const My = lazy(()=>import("../pages/my"))
const Home = lazy(()=>import("../pages/home"))
const Video = lazy(()=>import("../pages/video"))
const ShortVideo = lazy(()=>import("../pages/shortvideo"))
const Movie = lazy(()=>import("../pages/movie"))
const Notfond = lazy(()=>import("../pages/notfond"))
const Login = lazy(()=>import("../pages/login"))
const Detail = lazy(()=>import("../pages/detail"))
const routerconfig = [
     {
         path:"/home",
         element:<Home></Home>,
         children:[
             {
                 path:"/home/movie",
                 element:<Movie></Movie>
             },
             {
                path:"/home/video",
                element:<Video></Video>
             },
             {
                 path:"/home/shortVido",
                 element:<ShortVideo></ShortVideo>
             },
             {
                 path:"/home/show",
                 element:<Show></Show>
             },
             {
                  path:"/home",
                  element:<Navigate to="/home/movie"></Navigate>
             }
         ]
     },
     {
         path:"/my",
         element:<My></My>
     },
     {
         path:"/detail",
         element:<Detail></Detail>
     },
     {
         path:"/",
         element:<Navigate to="/home"></Navigate>
     },
     {
        path:"/login",
        element:<Login></Login>
     },
     {
         path:"*",
         element:<Notfond></Notfond>
         
     }
]
export default routerconfig
